﻿Imports System.Net.Mail
Imports System.Net
Imports System
Public Class Form5

    Private Sub Textbox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Textbox1.SelectedIndexChanged

    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Dim smtpServer As New SmtpClient
        Dim mail As New MailMessage()
        smtpServer.Credentials = New Net.NetworkCredential("colby.whittle@hotmail.com", "1597rgw")
        smtpServer.Port = 587
        smtpServer.Host = "smtp.live.com"
        smtpServer.EnableSsl = True
        mail = New MailMessage()
        mail.From = New MailAddress("colby.whittle@hotmail.com")
        mail.To.Add("colby.whittle@hotmail.com")
        mail.Subject = Textbox1.Text
        mail.Body = TextBox2.Text
        smtpServer.Send(mail)
        MsgBox("Your message has been sent!", MsgBoxStyle.Information)
    End Sub
End Class